package com.huak.zookeeper.controller;

import com.huak.zookeeper.spel.Hello;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuhuan
 * @date 2018/9/15 15:24
 * @description
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Value("#{T(com.huak.zookeeper.spel.UserNameCreator).createUserName()}")
    private String username;

    @GetMapping("get/{username}")
    @Hello("T(com.huak.zookeeper.spel.UserNameCreator).createUserName()")
    public String get(@PathVariable("username") String username){
        return username;
    }
}
